﻿using EkStudio.com.bean.xml.BillMapping;
using System.ComponentModel;

namespace EkStudio.com.ui.unitbill.property
{
    public class BillMapToProperty
    {
        log4net.ILog logger = log4net.LogManager.GetLogger(typeof(BillMapToProperty));

        private BillDataMapItem bill = null;

        public BillMapToProperty(BillDataMapItem bean)
        {
            bill = bean;
        }
        
        public string Caption
        {
            get { return bill.MapProperties.Caption; }
            set { bill.MapProperties.Caption = value; }
        }
        public string Key
        {
            get { return bill.MapProperties.Key; }
            set { bill.MapProperties.Key = value; }
        }
        [Description("压缩文档数据节省空间")]
        public bool Compress
        {
            get { return bill.MapProperties.Compress; }
            set { bill.MapProperties.Compress = value; }
        }
        [DescriptionAttribute("每日库存数据自动备份")]
        public bool LogEnable
        {
            get { return bill.MapProperties.Advanced.LogEnable; }
            set { bill.MapProperties.Advanced.LogEnable = value; }
        }
        [Description("库存的结算字段设置，用于库存计算类的字段")]
        public string Target
        {
            get { return bill.MapProperties.Target == null ? "[NULL]" : "[Collect]"; }
            set { }
        }

        [DescriptionAttribute("库存的数据保存模块")]
        public string Advanced
        {
            get { return bill.MapProperties.Advanced.ModCaption; }
            set { bill.MapProperties.Advanced.ModCaption = value; }
        }
        [DescriptionAttribute("库存结存类型设置")]
        public string Balance
        {
            get { return bill.MapProperties.Balance; }
            set { bill.MapProperties.Balance = value; }
        }
        [DescriptionAttribute("库存结存执行在哪一天，如每月的第1天，最小为1，最大为26")]
        public int IndexDay
        {
            get { return bill.MapProperties.IndexDay ; }
            set { bill.MapProperties.IndexDay = value; }
        }
        [DescriptionAttribute("库存结存的执行时间")]
        public string RunTimer
        {
            get { return bill.MapProperties.RunTimer; }
            set { bill.MapProperties.RunTimer = value; }
        }
        [DescriptionAttribute("库存结存的月份类型，如1号结存，则应是结存当月时间，如26号结存则是下月时间")]
        public string MonthType
        {
            get { return bill.MapProperties.MonthType; }
            set { bill.MapProperties.MonthType = value; }
        }

        public string Creater
        {
            get { return bill.MapProperties.Owner.Creater; }
            set { }
        }
        public string Created
        {
            get { return bill.MapProperties.Owner.Created; }
            set { }
        }
        public string LastMender
        {
            get { return bill.MapProperties.Owner.LastMender; }
            set { }
        }
        public string LastModified
        {
            get { return bill.MapProperties.Owner.LastModified; }
            set { }
        }




    }
}
